// mock/user.bundled_lk60jwib0os.bundled_iyxnk9bk9yr.mjs
function createUserList() {
  return [
    {
      userId: 1,
      avatar: "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
      username: "admin",
      password: "111111",
      desc: "\u5E73\u53F0\u7BA1\u7406\u5458",
      roles: ["\u5E73\u53F0\u7BA1\u7406\u5458"],
      buttons: ["cuser.detail"],
      routes: ["home"],
      token: "Admin Token"
    },
    {
      userId: 2,
      avatar: "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
      username: "system",
      password: "111111",
      desc: "\u7CFB\u7EDF\u7BA1\u7406\u5458",
      roles: ["\u7CFB\u7EDF\u7BA1\u7406\u5458"],
      buttons: ["cuser.detail", "cuser.user"],
      routes: ["home"],
      token: "System Token"
    }
  ];
}
var user_default = [
  //  用户登录接口
  {
    url: "/api/user/login",
    method: "post",
    response: ({ body }) => {
      const { username, password } = body;
      const checkUser = createUserList().find(
        (item) => item.username === username && item.password === password
      );
      if (!checkUser) {
        return {
          code: 201,
          data: {
            message: "\u8D26\u53F7\u5BC6\u7801\u4E0D\u6B63\u786E"
          }
        };
      }
      const { token } = checkUser;
      return {
        code: 200,
        data: {
          token
        }
      };
    }
  },
  // 获取用户信息接口
  {
    url: "/api/user/info",
    method: "get",
    response: (request) => {
      const token = request.headers.token;
      const checkUser = createUserList().find((item) => {
        return item.token === token;
      });
      if (!checkUser) {
        return {
          code: 201,
          data: {
            message: "\u83B7\u53D6\u7528\u6237\u4FE1\u606F\u5931\u8D25"
          }
        };
      }
      return {
        code: 200,
        data: {
          checkUser
        }
      };
    }
  }
];
export {
  user_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsibW9jay9tb2NrL21vY2svdXNlci50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiY29uc3QgX19pbmplY3RlZF9maWxlbmFtZV9fID0gXCJDOlxcXFxVc2Vyc1xcX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Y0XHU0RUJBXHJcbiAgICAgICAgICAgIGNvbnN0IGNoZWNrVXNlciA9IGNyZWF0ZVVzZXJMaXN0KCkuZmluZChcclxuICAgICAgICAgICAgICAgIChpdGVtKT0+aXRlbS51c2VybmFtZSA9PT0gdXNlcm5hbWUgJiYgaXRlbS5wYXNzd29yZCA9PT0gcGFzc3dvcmRcclxuICAgICAgICAgICAgKVxyXG4gICAgICAgIC8vICAgICBcdTZDQTFcdTY3MDlcdTc1MjhcdTYyMzdcdThGRDRcdTU2REVcdTU5MzFcdThEMjVcdTRGRTFcdTYwNkZcclxuICAgICAgICAgICAgaWYoIWNoZWNrVXNlcikge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgICAgICBjb2RlOiAyMDEsXHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YTp7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6J1x1OEQyNlx1NTNGN1x1NUJDNlx1NzgwMVx1NEUwRFx1NkI2M1x1Nzg2RSdcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAvLyAgICAgXHU2NzA5XHU1MjE5XHU4RkQ0XHU1NkRFXHU2MjEwXHU1MjlGXHU0RkUxXHU2MDZGXHJcbiAgICAgICAgICAgIGNvbnN0IHt0b2tlbn0gPSBjaGVja1VzZXJcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIGNvZGU6MjAwLFxyXG4gICAgICAgICAgICAgICAgZGF0YTp7XHJcbiAgICAgICAgICAgICAgICAgICAgdG9rZW5cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH0sXHJcbiAgICAvLyBcdTgzQjdcdTUzRDZcdTc1MjhcdTYyMzdcdTRGRTFcdTYwNkZcdTYzQTVcdTUzRTNcclxuICAgIHtcclxuICAgICAgICB1cmw6Jy9hcGkvdXNlci9pbmZvJyxcclxuICAgICAgICBtZXRob2Q6J2dldCcsXHJcbiAgICAgICAgcmVzcG9uc2U6KHJlcXVlc3QpID0+IHtcclxuICAgICAgICAvLyAgICAgXHU4M0I3XHU1M0Q2XHU4QkY3XHU2QzQyXHU1OTM0XHU2NDNBXHU1RTI2dG9rZW5cclxuICAgICAgICAgICAgY29uc3QgdG9rZW4gPSByZXF1ZXN0LmhlYWRlcnMudG9rZW5cclxuICAgICAgICAvLyAgICAgXHU2N0U1XHU3NzBCXHU3NTI4XHU2MjM3XHU0RkUxXHU2MDZGXHU2NjJGXHU1NDI2XHU1MzA1XHU1NDJCXHU2NzA5XHU2QjIxdG9rZW5cdTc1MjhcdTYyMzdcclxuICAgICAgICAgICAgY29uc3QgY2hlY2tVc2VyID0gY3JlYXRlVXNlckxpc3QoKS5maW5kKChpdGVtKT0+e1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGl0ZW0udG9rZW4gPT09IHRva2VuXHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIGlmKCFjaGVja1VzZXIpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29kZTogMjAxLFxyXG4gICAgICAgICAgICAgICAgICAgIGRhdGE6e1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOidcdTgzQjdcdTUzRDZcdTc1MjhcdTYyMzdcdTRGRTFcdTYwNkZcdTU5MzFcdThEMjUnXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgY29kZTogMjAwLFxyXG4gICAgICAgICAgICAgICAgZGF0YTp7XHJcbiAgICAgICAgICAgICAgICAgICAgY2hlY2tVc2VyXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgIC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